//! # vertica-rs
//! 
//! A native Rust client for Vertica databases, providing high-performance
//! connectivity and query execution capabilities.
//! 
//! ## Features
//! 
//! - **High Performance**: Native Rust implementation with minimal overhead
//! - **Connection Pooling**: Built-in connection pooling for efficient resource management
//! - **TLS Support**: Secure connections with SSL/TLS encryption
//! - **Type Safety**: Strongly typed API with comprehensive type conversions
//! - **Async Support**: Optional async support (planned)
//! - **Prepared Statements**: Support for prepared statements with parameter binding
//! - **Transaction Support**: Full ACID transaction support
//! 
//! ## Quick Start
//! 
//! ```rust
//! use vertica_rs::{Client, ConnectionConfig};
//! 
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//!     let config = ConnectionConfig::from_url("vertica://user:password@localhost:5433/database")?;
//!     let mut client = Client::connect(config)?;
//!     
//!     let result = client.query("SELECT * FROM users WHERE id = ?", &[1])?;
//!     for row in result {
//!         println!("User: {}", row.get_by_name::<String>("name")?);
//!     }
//!     
//!     Ok(())
//! }
//! */

#![warn(missing_docs)]

pub use crate::client::Client;
pub use crate::conn::ConnectionConfig;
pub use crate::error::{Result, VerticaError};
pub use crate::query::QueryResult;
pub use crate::row::Row;
pub use crate::types::Value;
// 公开模块
// 提供客户端核心功能，包含与数据库交互的主要接口
pub mod client;
// 处理连接配置相关功能，用于配置数据库连接信息
pub mod conn;
// 定义错误类型和错误处理逻辑
pub mod error;
// 处理查询相关操作，包含查询执行和结果处理
pub mod query;
// 处理查询结果行相关操作，用于解析和访问行数据
pub mod row;
// 定义与数据库交互的数据类型
pub mod types;
// 实现连接池功能，用于管理数据库连接资源
pub mod pool;
// 处理底层的输入输出操作，用于与数据库通信
pub mod io;

/// Re-export commonly used types
pub mod prelude {
    pub use crate::client::Client;
    pub use crate::conn::ConnectionConfig;
    pub use crate::error::Result;
    pub use crate::query::{QueryResult};
    pub use crate::row::Row;
    pub use crate::types::Value;
}

/// Version information
pub const VERSION: &str = env!("CARGO_PKG_VERSION");

/// Library information
pub fn version() -> &'static str {
    VERSION
}

/// Check if the library was compiled with TLS support
#[cfg(feature = "tls")]
pub fn has_tls_support() -> bool {
    true
}

#[cfg(not(feature = "tls"))]
pub fn has_tls_support() -> bool {
    false
}

/// Check if the library was compiled with connection pooling support
#[cfg(feature = "pool")]
pub fn has_pool_support() -> bool {
    true
}

#[cfg(not(feature = "pool"))]
/// Check if the library was compiled with connection pooling support
pub fn has_pool_support() -> bool {
    false
}